# 创建字典
student = {
    "name": "John",
    "age": 21,
    "major": "Computer Science"
}

# 访问字典中的值
print(student["name"])  # 输出: John

# 添加新键值对
student["GPA"] = 3.8

# 修改现有键值对
student["age"] = 22

# 删除键值对
del student["major"]

# 遍历字典
for key, value in student.items():
    print(f"{key}: {value}")